// https://nuxt.com/docs/api/configuration/nuxt-config
const dotenv = require('dotenv');
dotenv.config();
export default defineNuxtConfig({
        devtools: { enabled: true },
        ssr: true,
        modules: [
            '@pinia/nuxt',
            '@pinia-plugin-persistedstate/nuxt',
            '@element-plus/nuxt',
            '@nuxtjs/tailwindcss',
            '@vueuse/nuxt',
            "@nuxtjs/sitemap",
            '@nuxtjs/robots',
        ],
        vueuse: {
            ssrHandlers: true,
        },
        runtimeConfig:{
            public:{
                apiBase:process.env.NUXT_PUBLIC_API_BASE,
                imgBase:process.env.NUXT_PUBLIC_IMG_BASE,
            }
        },

        css:['~/assets/scss/index.scss'],
        typescript: {
            strict: true,
            shim: false,
        },

        elementPlus: {
            importStyle:'scss',
            themes:['dark'],
            icon: 'ElIcon',
        },
        vite: {
            plugins: [
            ],
            css: {
                preprocessorOptions: {
                    scss: {
                        additionalData: `@use "~/assets/scss/element/index.scss" as element;`,
                    },
                },
            },
        },
        tailwindcss: {
            cssPath: '~/assets/scss/tailwind.scss',
            configPath: '~/tailwind.config.ts',
            exposeConfig: true,
            viewer:true,
        },
        robots: {
            rules: {
                UserAgent: '*',
                disallow: '/admin/**,/backend/**',
                Host: 'https://lanming.cc',
                Allow:"*",
                Sitemap: 'https://lanming.cc/sitemap.xml',
            },
        },
        site:{
            url:'https://lanming.cc'
        },
        sitemap: {
            // debug:true,
            hostname:'https://lanming.cc',
            path: '/sitemap.xml',
            autoLastmod:true,
            xsl: false,
            // gzip: true,
            generate: false,
            siteMaps:false,
            cacheTime: 0,
            cacheMaxAgeSeconds:0,
            sources: ['/api/__sitemap__/urls'],
            exclude: ['/admin/**','/backend/**'],
        },
    }
)